﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Space
{
    public class Gun : Positioned
    {
        public float Range { get; set; }

        protected Ship Ship { get; set; }

        public Vector3 Offset { get; set; }

        public float FireInterval { get; set; }
        protected float fire = 0;

        public bool CanFire { get { return fire >= FireInterval; } }

        public ITarget Target { get; set; }

        protected Game Game { get { return Ship.Game; } }

        public Gun(Ship ship)
        {
            Ship = ship;
        }
        public virtual void Fire()
        {
            fire = 0;
        }

        public void Update(float time)
        {
            fire += time;
        }
    }
}
